home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / dosfunc.arc / DOSFUNC.LST
Encoding:
File List  |  1987-03-29  |  18.3 KB  |  557 lines

  1. INT 20 Program terminate
  2. Entry: CS->PSP
  3. Exit:  Does not return to caller
  4.  
  5. INT 21 Execute DOS function
  6. 00 Program terminate
  7.    Entry: CS->PSP
  8.    Exit:  Does not return to caller
  9. 01 Character input
  10.    Entry: None
  11.    Exit:  AL=character
  12. 02 Character output
  13.    Entry: DL=character
  14.    Exit:  None
  15. 03 Auxiliary input
  16.    Entry: None
  17.    Exit:  AL=character
  18. 04 Auxiliary output
  19.    Entry: DL=character
  20.    Exit:  None
  21. 05 Printer output
  22.    Entry: DL=character
  23.    Exit:  None
  24. 06 Direct console I/O
  25.    Entry: DL=FF for console input
  26.           DL=character for console output
  27.    Exit:  ZF=0 if a character is ready,AL=character
  28.           ZF=1 if no character is ready
  29. 07 Direct console input without echo
  30.    Entry: None
  31.    Exit:  AL=character
  32. 08 Console input without echo
  33.    Entry: None
  34.    Exit:  AL=character
  35. 09 Display string
  36.    Entry: DS:DX->string ending with $
  37.    Exit:  None
  38. 0A Buffered keyboard input
  39.    Entry: DS:DX->input buffer (first byte of buffer=maximum input length)
  40.    Exit:  second byte of buffer=number of characters read
  41. 0B Get input status
  42.    Entry: None
  43.    Exit:  AL=00 no character available
  44.           AL=FF character available
  45. 0C Reset input buffer and input
  46.    Entry: AL=function number (01,06,07,08,0A)
  47.           DS:DX->input buffer if function=0A
  48.    Exit:  AL=character unless function=0A
  49. 0D Disk reset
  50.    Entry: None
  51.    Exit:  None
  52. 0E Set default drive
  53.    Entry: DL=drive code (0=A)
  54.    Exit:  AL=number of logical drives
  55. 0F Open file
  56.    Entry: DS:DX->unopened FCB
  57.    Exit:  AL=00 file opened
  58.           AL=FF file not found
  59. 10 Close file
  60.    Entry: DS:DX->opened FCB
  61.    Exit:  AL=00 file closed
  62.           AL=FF file not found
  63. 11 Search for first match
  64.    Entry: DS:DX->unopened FCB
  65.    Exit:  AL=00 matching filename found
  66.                 buffer at DTA is filled with an unopened FCB
  67.           AL=FF matching filename not found
  68. 12 Search for next match
  69.    Entry: DS:DX->unopened FCB
  70.    Exit:  AL=00 matching filename found
  71.                 buffer at DTA is filled with an unopened FCB
  72.           AL=FF matching filename not found
  73. 13 Delete file
  74.    Entry: DS:DX->unopened FCB
  75.    Exit:  AL=00 file deleted
  76.           AL=FF matching filename not found or files are read-only
  77. 14 Sequential read
  78.    Entry: DS:DX->opened FCB
  79.    Exit:  AL=00 file was read
  80.           AL=01 EOF (no data read)
  81.           AL=02 segment wrap
  82.           AL=03 EOF (partial read)
  83. 15 Sequential write
  84.    Entry: DS:DX->opened FCB
  85.    Exit:  AL=00 file was written
  86.           AL=01 disk full
  87.           AL=02 segment wrap
  88. 16 Create or truncate file
  89.    Entry: DS:DX->unopened FCB
  90.    Exit:  AL=00 file created
  91.           AL=FF directory full
  92. 17 Rename file
  93.    Entry: DS:DX->modified FCB (FCB+11h->new filename)
  94.    Exit:  AL=00 file renamed
  95.           AL=FF no matching files found or new filename already exists
  96. 18 Reserved
  97. 19 Get default drive
  98.    Entry: None
  99.    Exit:  AL=drive code (0=A)
  100. 1A Set disk transfer address
  101.    Entry: DS:DX=new DTA
  102.    Exit:  None
  103. 1B Get allocation info for default drive
  104.    Entry: None
  105.    Exit:  AL=sectors/cluster
  106.           CX=bytes/sector
  107.           DX=clusters/drive
  108.           DS:BX->media descriptor byte
  109. 1C Get allocation info for specified drive
  110.    Entry: DL=drive code (0=default,1=A)
  111.    Exit:  AL=sectors/cluster
  112.           CX=bytes/sector
  113.           DX=clusters/drive
  114.           DS:BX->media descriptor byte
  115.           AL=FF invalid drive
  116. 1D Reserved
  117. 1E Reserved
  118. 1F Get disk parameter block for default drive (*)
  119.    Entry: None
  120.    Exit:  DS:BX->disk parameter block
  121.              0 drive code                   11 number of system sectors
  122.              1 unit code                    13 last cluster number
  123.              2 bytes per sector             15 sectors per FAT
  124.              4 sectors per cluster-1        16 first directory sector
  125.              5 disk type                    18 pointer to device driver
  126.              6 number of reserved sectors   22 media descriptor byte
  127.              8 number of FATs               23 reserved
  128.              9 number of directory entries  24 pointer to next DPB
  129.              * disk types: 0=single sided floppy disk,2=AT fixed disk
  130.                            1=double sided floppy disk,3=XT fixed disk
  131. 20 Reserved
  132. 21 Random read
  133.    Entry: DS:DX->opened FCB
  134.    Exit:  AL=00 file was read
  135.           AL=01 EOF (no data read)
  136.           AL=02 segment wrap
  137.           AL=03 EOF (partial read)
  138. 22 Random write
  139.    Entry: DS:DX->opened FCB
  140.    Exit:  AL=00 file was written
  141.           AL=01 disk full
  142.           AL=02 segment wrap
  143. 23 Get file size in records
  144.    Entry: DS:DX->unopened FCB
  145.    Exit:  AL=00 FCB random record field is set based on number of records
  146.                 and record size
  147.           AL=FF file not found
  148. 24 Set random record number
  149.    Entry: DS:DX->opened FCB
  150.    Exit:  random record field is set based on record size,current record
  151.           and current block
  152. 25 Set interrupt vector
  153.    Entry: DS:DX=new address
  154.           AL=interrupt number
  155.    Exit:  None
  156. 26 Create program segment prefix
  157.    Entry: DX=segment for new PSP
  158.    Exit:  None
  159. 27 Random block read
  160.    Entry: DS:DX->opened FCB
  161.           CX=number of records to read
  162.    Exit:  AL=00 file was read
  163.           AL=01 EOF (no data read)
  164.           AL=02 segment wrap
  165.           AL=03 EOF (partial read)
  166.           CX=actual number of records read
  167. 28 Random block write
  168.    Entry: DS:DX->opened FCB
  169.           CX=number of records to write
  170.    Exit:  AL=00 file was written
  171.           AL=01 disk full
  172.           AL=02 segment wrap
  173.           CX=actual number of records written
  174. 29 Parse filename
  175.    Entry: DS:SI->string to parse
  176.           ES:DI->buffer for unopened FCB
  177.           AL=flags
  178.              Bit 3=1 modify FCB extension only if an extension is specified
  179.              Bit 2=1 modify FCB filename only if a filename is specified
  180.              Bit 1=1 modify FCB drive id byte only if a drive is specified
  181.              Bit 0=1 scan off leading separators
  182.    Exit:  DS:SI->first character after parsed filename
  183.           AL=00 no wildcard characters in string
  184.           AL=01 wildcard characters in string
  185.           AL=FF invalid drive
  186. 2A Get date
  187.    Entry: None
  188.    Exit:  AL=day of week (0=Sun)
  189.           CX=year
  190.           DH=month
  191.           DL=day
  192. 2B Set date
  193.    Entry: CX=year
  194.           DH=month
  195.           DL=day
  196.    Exit:  AL=00 date set
  197.           AL=FF invalid date
  198. 2C Get time
  199.    Entry: None
  200.    Exit:  CH=hours
  201.           CL=minutes
  202.           DH=seconds
  203.           DL=hundredths
  204. 2D Set time
  205.    Entry: CH=hours
  206.           CL=minutes
  207.           DH=seconds
  208.           DL=hundredths
  209.    Exit:  AL=00 time set
  210.           AL=FF invalid time
  211. 2E Set verify flag
  212.    Entry: AL=0 verify off
  213.           AL=1 verify on
  214.    Exit:  None
  215. 2F Get disk transfer address
  216.    Entry: None
  217.    Exit:  ES:BX=DTA
  218. 30 Get DOS version
  219.    Entry: None
  220.    Exit:  AL=major version number
  221.           AH=minor version number
  222. 31 Terminate and stay resident
  223.    Entry: AL=return code
  224.           DX=memory size in paragraphs
  225.    Exit:  Does not return to caller
  226. 32 Get disk parameter block for specified drive (*)
  227.    Entry: DL=drive code (0=default,1=A)
  228.    Exit:  DS:BX->disk parameter block
  229.              0 drive code                   11 number of system sectors
  230.              1 unit code                    13 last cluster number
  231.              2 bytes per sector             15 sectors per FAT
  232.              4 sectors per cluster-1        16 first directory sector
  233.              5 disk type                    18 pointer to device driver
  234.              6 number of reserved sectors   22 media descriptor byte
  235.              8 number of FATs               23 reserved
  236.              9 number of directory entries  24 pointer to next DPB
  237.              * disk types: 0=single sided floppy disk,2=AT fixed disk
  238.                            1=double sided floppy disk,3=XT fixed disk
  239.           AL=FF invalid drive
  240. 33 Get or set Ctrl-break
  241.    Entry: AL=0 get break
  242.           AL=1 set break,DL=0 break off
  243.                          DL=1 break on
  244.    Exit:  DL=0 break off
  245.           DL=1 break on
  246. 34 Get DOS call depth (*)
  247.    Entry: None
  248.    Exit:  ES:BX->DOS call depth
  249. 35 Get interrupt vector
  250.    Entry: AL=interrupt number
  251.    Exit:  ES:BX=interrupt address
  252. 36 Get free disk space
  253.    Entry: DL=drive code (0=default,1=A)
  254.    Exit:  AX=sectors/cluster
  255.           BX=free clusters
  256.           CX=bytes/sector
  257.           DX=clusters/drive
  258.           AX=FFFF if drive invalid
  259. 37 Get or set switch character (*)
  260.    Entry: AL=0 get switch character
  261.           AL=1 set switch character,DL=new value
  262.    Exit:  DL=switch character if get request
  263. 38 Get or set country info
  264.    Entry: AL=country code (0=current country)
  265.           AL=FF,BX=country code>=255
  266.           DS:DX->buffer for get request
  267.           DX=FFFF set request
  268.    Exit:  CF=0 BX=country code for get request
  269.           CF=1 AX=error code
  270. 39 Create subdirectory
  271.    Entry: DS:DX->asciiz string
  272.    Exit:  CF=0 None
  273.           CF=1 AX=error code
  274. 3A Remove subdirectory
  275.    Entry: DS:DX->asciiz string
  276.    Exit:  CF=0 None
  277.           CF=1 AX=error code
  278. 3B Change current directory
  279.    Entry: DS:DX->asciiz string
  280.    Exit:  CF=0 None
  281.           CF=1 AX=error code
  282. 3C Create or truncate file
  283.    Entry: DS:DX->asciiz string
  284.           CX=attribute byte
  285.    Exit:  CF=0 None
  286.           CF=1 AX=error code
  287. 3D Open file
  288.    Entry: DS:DX->asciiz string
  289.           AL=open mode
  290.              Bits 0-2 access mode
  291.                       000=read
  292.                       001=write
  293.                       010=read/write
  294.              Bit  3   reserved
  295.              Bits 4-6 sharing mode
  296.                       000=compatibility
  297.                       001=read/write access denied
  298.                       010=write access denied
  299.                       011=read access denied
  300.                       100=full access permitted
  301.              Bit  7   inheritance flag
  302.                       0=file inherited by subprocess
  303.                       1=file private to current process
  304.    Exit:  CF=0 AX=file handle
  305.           CF=1 AX=error code
  306. 3E Close file
  307.    Entry: BX=file handle
  308.    Exit:  CF=0 None
  309.           CF=1 AX=error code
  310. 3F Read file or device
  311.    Entry: BX=file handle
  312.           CX=bytes to read
  313.           DS:DX->input buffer
  314.    Exit:  CF=0 AX=number of bytes read or 0 if EOF
  315.           CF=1 AX=error code
  316. 40 Write file or device
  317.    Entry: BX=file handle
  318.           CX=bytes to write
  319.           DS:DX->output buffer
  320.    Exit:  CF=0 AX=number of bytes written or 0 if disk full
  321.           CF=1 AX=error code
  322. 41 Delete file
  323.    Entry: DS:DX->asciiz string
  324.    Exit:  CF=0 None
  325.           CF=1 AX=error code
  326. 42 Move file pointer
  327.    Entry: AL=code (0=absolute,1=relative,2=relative to EOF)
  328.           BX=file handle
  329.           CX:DX=offset
  330.    Exit:  CF=0 DX:AX=new pointer
  331.           CF=1 AX=error code
  332. 43 Get or set file attributes
  333.    Entry: AL=0 get attributes
  334.           AL=1 set attributes,CX=attribute byte
  335.           DS:DX->asciiz string
  336.    Exit:  CF=0 CX=attribute byte if get request
  337.           CF=1 AX=error code
  338. 44 I/O control for devices
  339.    Entry: AL=function
  340.              00 get device info
  341.              01 set device info
  342.              02 read from character device
  343.              03 write to character device
  344.              04 read from block device
  345.              05 write to block device
  346.              06 get input status
  347.              07 get output status
  348.              08 removable media check
  349.              09 local/remote drive check
  350.              0A local/remote handle check
  351.              0B change sharing retry count
  352.           BX=file handle or drive code (0=default,1=A)
  353.           CX=number of bytes
  354.           DS:DX->buffer for functions 02-05
  355.           DX=device info for function 01
  356.              Character devices:        Block devices:
  357.              Bit 0 1=console input     Bit 0-5 drive code (0=A)
  358.                  1 1=console output          6 0=file has been written
  359.                  2 1=nul                     7 0=block device
  360.                  3 1=clock                8-15 reserved
  361.                  4 reserved
  362.                  5 0=ascii,1=binary
  363.                  6 0=eof on input
  364.                  7 1=character device
  365.               8-15 reserved
  366.    Exit:  CF=0 DX=device info for function 00
  367.                AX=number of bytes for functions 02-05
  368.                AL=status for functions 06-07 (00=not ready,FF=ready)
  369.                AX=value for function 08 (0=removable,1=fixed)
  370.           CF=1 AX=error code
  371. 45 Duplicate handle
  372.    Entry: BX=file handle
  373.    Exit:  CF=0 AX=new file handle
  374.           CF=1 AX=error code
  375. 46 Force duplicate of handle
  376.    Entry: BX=file handle
  377.           CX=new file handle
  378.    Exit:  CF=0 None
  379.           CF=1 AX=error code
  380. 47 Get current directory
  381.    Entry: DS:SI->64-byte buffer for pathname
  382.           DL=drive code (0=default,1=A)
  383.    Exit:  CF=0 buffer is filled with pathname
  384.           CF=1 AX=error code
  385. 48 Allocate memory
  386.    Entry: BX=number of paragraphs to allocate
  387.    Exit:  CF=0 AX=segment of allocated block
  388.           CF=1 AX=error code
  389.                BX=size of largest available block
  390. 49 Release memory
  391.    Entry: ES=segment of block to release
  392.    Exit:  CF=0 None
  393.           CF=1 AX=error code
  394. 4A Modify allocated memory
  395.    Entry: BX=number of paragraphs to allocate
  396.           ES=segment of block to modify
  397.    Exit:  CF=0 AX=segment of allocated block
  398.           CF=1 AX=error code
  399.                BX=size of largest available block
  400. 4B Execute program
  401.    Entry: AL=0 load and execute
  402.           AL=1 load only
  403.           AL=3 load overlay
  404.           DS:DX->asciiz string
  405.           ES:BX->parameter block
  406.              AL=0,1  0 environment block segment or 0
  407.                      2 command tail pointer
  408.                      6 FCB1 pointer or -1
  409.                     10 FCB2 pointer or -1
  410.              AL=3    0 segment where file will be loaded
  411.                      2 relocation factor
  412.    Exit:  CF=0 all registers except CS and IP are destroyed
  413.                parameter block if load only:
  414.                  14 SS:SP of loaded program
  415.                  18 CS:IP of loaded program
  416.           CF=1 AX=error code
  417. 4C Terminate with return code
  418.    Entry: AL=return code
  419.    Exit:  Does not return to caller
  420. 4D Get return code of subprocess
  421.    Entry: None
  422.    Exit:  AL=return code
  423.           AH=exit type (0=normal,1=Ctrl-C,2=critical error,3=function 31h)
  424. 4E Find first matching file
  425.    Entry: DS:DX->asciiz string
  426.           CX=attribute byte
  427.    Exit:  CF=0 DTA    reserved
  428.                DTA+21 attribute byte
  429.                DTA+22 file time
  430.                DTA+24 file date
  431.                DTA+26 file size
  432.                DTA+30 filename
  433.           CF=1 AX=error code
  434. 4F Find next matching file
  435.    Entry: buffer at DTA must be set from previous 4E or 4F call
  436.    Exit:  CF=0 DTA    reserved
  437.                DTA+21 attribute byte
  438.                DTA+22 file time
  439.                DTA+24 file date
  440.                DTA+26 file size
  441.                DTA+30 filename
  442.           CF=1 AX=error code
  443. 50 Set program segment prefix address (*)
  444.    Entry: BX=segment of PSP
  445.    Exit:  None
  446. 51 Get program segment prefix address (*)
  447.    Entry: None
  448.    Exit:  BX=segment of PSP
  449. 52 Get disk parameter block list (*)
  450.    Entry: None
  451.    Exit:  ES:BX->disk parameter block list
  452.           ES:(BX-2)->memory control block anchor
  453. 53 Create disk parameter block (*)
  454.    Entry: DS:SI->BIOS parameter block
  455.           ES:BP->buffer for disk parameter block
  456.    Exit:  None
  457. 54 Get verify flag
  458.    Entry: None
  459.    Exit:  AL=0 verify off
  460.           AL=1 verify on
  461. 55 Create duplicate program segment prefix (*)
  462.    Entry: DX=segment for new PSP
  463.           SI=new end of allocation
  464.    Exit:  None
  465. 56 Rename file
  466.    Entry: DS:DX->asciiz string
  467.           ES:DI->asciiz string (new filename)
  468.    Exit:  CF=0 None
  469.           CF=1 AX=error code
  470. 57 Get or set file date and time
  471.    Entry: AL=0 get date and time
  472.           AL=1 set date and time,CX=time,DX=date
  473.           BX=file handle
  474.    Exit:  CF=0 CX=time if get request
  475.                DX=date if get request
  476.           CF=1 AX=error code
  477. 58 Get or set allocation strategy
  478.    Entry: AL=0 get strategy
  479.           AL=1 set strategy,BX=code (0=first fit,1=best fit,2=last fit)
  480.    Exit:  CF=0 AX=strategy code if get request
  481.           CF=1 AX=error code
  482. 59 Get extended error info
  483.    Entry: None
  484.    Exit:  AX=extended error code
  485.           BH=error class
  486.           BL=suggested action
  487.           CH=locus
  488. 5A Create unique file
  489.    Entry: DS:DX->asciiz string (path ending with \)
  490.           CX=attribute byte
  491.    Exit:  CF=0 AX=file handle (filename is appended to path)
  492.           CF=1 AX=error code
  493. 5B Create new file
  494.    Entry: DS:DX->asciiz string
  495.           CX=attribute byte
  496.    Exit:  CF=0 AX=file handle
  497.           CF=1 AX=error code
  498. 5C Lock or unlock a file
  499.    Entry: AL=0 lock
  500.           AL=1 unlock
  501.           BX=file handle
  502.           CX:DX=region offset
  503.           SI:DI=region length
  504.    Exit:  CF=0 None
  505.           CF=1 AX=error code
  506. 5D Reserved (?)
  507. 60 Parse filename extended (*)
  508.    Entry: DS:SI->asciiz string
  509.           ES:DI->buffer for parsed string
  510.    Exit:  CF=0 buffer is filled with parsed string
  511.           CF=1 AX=error code
  512. 61 Reserved
  513. 62 Get program segment prefix address
  514.    Entry: None
  515.    Exit:  BX=segment of PSP
  516. 63 Reserved
  517. 64 Reserved (?)
  518.  
  519. INT 25 Absolute disk read
  520. Entry: AL=drive number (0=A)
  521.        CX=number of sectors
  522.        DX=starting sector number
  523.        DS:BX->input buffer
  524. Exit:  All registers except the segment registers and SP may be destroyed
  525.        CF=0 None
  526.        CF=1 AX=error code
  527. Note:  The original flags are still on the stack after an INT 25
  528.  
  529. INT 26 Absolute disk write
  530. Entry: AL=drive number (0=A)
  531.        CX=number of sectors
  532.        DX=starting sector number
  533.        DS:BX->output buffer
  534. Exit:  All registers except the segment registers and SP may be destroyed
  535.        CF=0 None
  536.        CF=1 AX=error code
  537. Note:  The original flags are still on the stack after an INT 26
  538.  
  539. INT 27 Terminate and stay resident
  540. Entry: DX->last byte to stay resident+1
  541. Exit:  Does not return to caller
  542.  
  543. INT 28 Execute background task (*)
  544. Entry: None
  545. Exit:  None
  546. Note:  This interrupt is called by DOS while waiting for input
  547.        INT 28 is normally a nop but may be intercepted by any program
  548.        that needs to be run as a background task
  549.  
  550. INT 29 ANSI.SYS character output (*)
  551. Entry: AL=character
  552. Exit:  None
  553.  
  554. INT 2E Execute command (*)
  555. Entry: DS:SI->command string-1 followed by a carriage return
  556. Exit:  All registers except CS and IP are destroyed
  557.